package com.smxy.mall.controller;

import com.smxy.mall.common.Response;
import com.smxy.mall.model.request.SwiperReq;
import com.smxy.mall.service.SwiperService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "轮播图管理")
@RestController
@RequestMapping("/swiper")
public class SwiperController {
    @Resource
    private SwiperService swiperService;

    @ApiOperation("添加编辑轮播图")
    @PostMapping("/save")
    public Object save(SwiperReq swiperReq){
        return Response.success(swiperService.save(swiperReq));
    }

    @ApiOperation("轮播图列表")
    @GetMapping("/list")
    public Object list(SwiperReq swiperReq){
        return Response.success(swiperService.list(swiperReq));
    }
}
